package com.idanchuang.component.sequence.id.config;

/**
 * @author yjy
 * @date 2020/8/24 10:54
 **/
public class SequenceConfigBean {

    /**
     * 暂存队列的长度
     */
    private Integer localQueueSize = 200;
    /**
     * 批量获取id的数量限制
     */
    private Integer maxBatchCount = 100000;
    /**
     * ID获取线程池-核心线程数
     */
    private Integer corePoolSize = 1;
    /**
     * ID获取线程池-最大线程数
     */
    private Integer maximumPoolSize = 3;
    /**
     * ID获取线程池-空闲线程保留时间 (秒)
     */
    private Integer workKeepAliveTime = 600;
    /**
     * ID获取线程池-任务队列长度
     */
    private Integer workQueueSize = 100;
    /**
     * 允许rpc重试
     */
    private boolean enableRetryRpc = true;

    public Integer getLocalQueueSize() {
        return localQueueSize;
    }

    public void setLocalQueueSize(Integer localQueueSize) {
        this.localQueueSize = localQueueSize;
    }

    public Integer getMaxBatchCount() {
        return maxBatchCount;
    }

    public void setMaxBatchCount(Integer maxBatchCount) {
        this.maxBatchCount = maxBatchCount;
    }

    public Integer getCorePoolSize() {
        return corePoolSize;
    }

    public void setCorePoolSize(Integer corePoolSize) {
        this.corePoolSize = corePoolSize;
    }

    public Integer getMaximumPoolSize() {
        return maximumPoolSize;
    }

    public void setMaximumPoolSize(Integer maximumPoolSize) {
        this.maximumPoolSize = maximumPoolSize;
    }

    public Integer getWorkQueueSize() {
        return workQueueSize;
    }

    public void setWorkQueueSize(Integer workQueueSize) {
        this.workQueueSize = workQueueSize;
    }

    public Integer getWorkKeepAliveTime() {
        return workKeepAliveTime;
    }

    public void setWorkKeepAliveTime(Integer workKeepAliveTime) {
        this.workKeepAliveTime = workKeepAliveTime;
    }

    public boolean isEnableRetryRpc() {
        return enableRetryRpc;
    }

    public void setEnableRetryRpc(boolean enableRetryRpc) {
        this.enableRetryRpc = enableRetryRpc;
    }

    @Override
    public String toString() {
        return "SequenceConfigBean{" +
                "localQueueSize=" + localQueueSize +
                ", maxBatchCount=" + maxBatchCount +
                ", corePoolSize=" + corePoolSize +
                ", maximumPoolSize=" + maximumPoolSize +
                ", workKeepAliveTime=" + workKeepAliveTime +
                ", workQueueSize=" + workQueueSize +
                ", enableRetryRpc=" + enableRetryRpc +
                '}';
    }
}
